import java.util.Scanner;

public class Exer3_8_10 {
    public static void main(String[] args) {
        Scanner input = new Scanner(System.in);
        System.out.println("请输入任意一个整数");
        int j=input.nextInt();
        int sum=0;
        while(j>0){
            sum+=j%10;
            j=j/10;
        }
        System.out.println("各位数之和为："+sum);
    }
}
